package javase2.day02;

import java.util.Date;

public class Demo1 {
  public static void main(String[] args) {
    String s1 = "ABC";
    String s2 = "BCD";
    String s3 = "BCD";
    System.out.println(s1.compareTo(s2));//<0 s1С��s2
    System.out.println(s2.compareTo(s1));//>0 s2����s1
    System.out.println(s3.compareTo(s2));//=0 s3����s2
    
    long now = System.currentTimeMillis();
    Date d1 = new Date(now);
    Date d2 = new Date(now);
    Date d3 = new Date(now+1);
    System.out.println(d1.compareTo(d2));//=0 d1����d2
    System.out.println(d1.compareTo(d3));//<0 d1С��d3
    System.out.println(d3.compareTo(d1));//>0 d3����d1
    System.out.println(d1.equals(d2));//d1����d2 
    System.out.println(d1.equals(d3));//d1������d3
    System.out.println(d1.hashCode());
    System.out.println(d2.hashCode());
    System.out.println(d3.hashCode());
    
    
    
  }
}
